// 定义一个构造函数
function Person(name, age) {
  this.name = name;
  this.age = age;
  console.log("this:", this)
  // 可以添加方法
  this.sayHello = function() {
    console.log(`Hello, my name is ${this.name}`);
  };
}

// 使用构造函数创建对象实例
const person1 = new Person("Alice", 30);
const person2 = new Person("Bob", 25);

person1.sayHello(); // 输出: Hello, my name is Alice
person2.sayHello(); // 输出: Hello, my name is Bob
